package com.glodon.paas.document.web.controller;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.glodon.paas.consts.StringConst;
import com.glodon.paas.document.api.bean.MemberView;
import com.glodon.paas.document.service.ProjectService;
import com.glodon.paas.document.web.util.SecurityUtils;

/**
 *
 * 
 * @author xur
 */
@Controller
@RequestMapping("/project/org")
public class ProjectOrgController {

    public static final Logger LOGGER = LoggerFactory.getLogger(ProjectOrgController.class);
    @Autowired
    private ProjectService     projectService;
    @RequestMapping(value = "", method = RequestMethod.GET)
    public void getOrg(@RequestParam("projectId")String projectId,@RequestParam("roleId")String roleId,ModelMap model) {
        List<MemberView> resultList = projectService.getOrg(SecurityUtils.getCurrentUser().getId(),projectId,roleId);
        model.addAttribute(StringConst.ITEMS, resultList);
    }
}
